﻿@using System.Reflection
<!DOCTYPE html>

<html lang="ko">
    <head>
        <title>@ViewBag.Title</title>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta name="description" content="" />
        <meta name="author" content="Hinoky::soyoung jeong" />
        @RenderSection("metatags", required: false)
        
        <!-- (s) favicon (s) -->
        <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
        <link rel="icon" href="/favicon.ico" type="image/x-icon">

        <link href="/Content/bootstrap.css" rel="stylesheet" />
        <link href="/Content/main.css" type="text/css" rel="stylesheet" />
        <style type="text/css">
            
        </style>
        <!--[if lt IE 9]>
            <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
        <script src="/Scripts/jquery-2.1.0.js" type="text/javascript"> </script>
        <script src="/Scripts/jquery-ui-1.10.4.js" type="text/j avascript"> </script>
        <script src="/Scripts/jquery.validate.js" type="text/javascript"> </script>
        <script src="/Scripts/customJS/common.js" type="text/javascript"> </script>
        <script type="text/javascript">
            $(document).ready(function () {

                //$('.carousel').carousel({ interval: false });

                /* affix the navbar after scroll below header */
                $('#nav').affix({
                    offset: {
                        top: $('header').height() - $('#nav').height()
                    }
                });

                /* highlight the top nav as scrolling occurs */
                $('body').scrollspy({ target: '#nav' });

                /* smooth scrolling for scroll to top */
                $('.scroll-top').click(function () {
                    $('body,html').animate({ scrollTop: 0 }, 500);
                });

                /* smooth scrolling for nav sections */
                $('#nav .navbar-nav li>a').click(function () {
                    var link = $(this).attr('href');
                    var posi = $(link).offset().top;
                    $('body,html').animate({ scrollTop: posi }, 700);
                });

                /* get user profile */
                $.ajax({
                    type: "GET",
                    async: false,
                    url: "/member/getuserprofile",
                    success: function (data) {
                        if (data.IsLogin) {
                            $("#imgProfileUploadArea").attr("src", data.ProfileImageUrl == null || data.ProfileImageUrl == "" ? "/images/drop-your-drawers-here.jpg" : data.ProfileImageUrl);
                        }
                    },
                    error: function (xhr, status, error) {

                    }
                });

                /* get mainkeyword and setting*/
                $.ajax({
                    type: "GET",
                    async: false,
                    url: "/home/getmainkeywordlist",
                    success: function (data) {
                        if (data.KeywordData) {
                            var html = "";
                            for (var i = 0; i < data.KeywordData.length; i++) {
                                html += "<div onclick='return false' data-toggle='tooltip' data-placement='top' data-original-title='" + data.KeywordData[i].LinkUrl + "' data-target='" + data.KeywordData[i].LinkTarget + "' style='float:left !important; padding:6px; font-size:" + data.KeywordData[i].Size + "px; color:" + data.KeywordData[i].Color + "; cursor:pointer;'>" + data.KeywordData[i].Keyword + "</div>";
                            }

                            $("#divMainKeyword").html(html);

                            $("#divMainKeyword div").tooltip();
                            $("#divMainKeyword div").on("click", function () {
                                window.open($(this).attr("data-original-title"), $(this).attr("data-target"));
                            });
                        }
                    },
                    error: function (xhr, status, error) {

                    }
                });

                /* set user profile pic */
                $("#imgProfileUploadArea").on("dragover", function (ev) {
                    ev.preventDefault();
                }).on("drop", function (ev) {
                    ev.preventDefault();
                    var filelist = ev.originalEvent.dataTransfer.files;

                    if (filelist.length != 1)
                        return bootbox.alert("이미지는 1개만 등록가능합니다.", null);

                    if (filelist[0].type.indexOf("image") == -1)
                        return bootbox.alert("이미지 파일만 업로드 가능합니다.", function () { });

                    if (filelist[0].size > 1000000) {
                        return bootbox.alert("파일의 용량이 커서 업로드가 제한되었습니다.", function () { });
                    }

                    var img = $("#imgProfileUploadArea").attr("data-filename", filelist[0].name);
                    img.file = filelist[0];

                    var reader = new FileReader();
                    reader.onload = function () {
                        img.attr("src", reader.result);
                    };
                    reader.readAsDataURL(filelist[0]);

                    return false;
                });

                $("#btnLogout").on("click", function() {
                    $.ajax({
                        type: "POST",
                        async: false,
                        url: "/member/Logout",
                        success: function(data) {
                            if (data.Success) {
                                location.href = "/";
                            } else {
                                return bootbox.alert(data.Message, null);
                            }
                        },
                        error: function(xhr, status, error) {
                            return bootbox.alert(error, null);
                        }
                    });

                    return false;
                });
            });
        </script>
    </head>
    <!-- HTML code from Bootply.com editor -->
    
    <body>
        <!-- Wrap all page content here -->
        <div id="wrap">
            
            <!-- (s) 페이스북 공통 영역 (s) -->
            <div id="fb-root"></div>
            <script type="text/javascript" >
                window.fbAsyncInit = function () {
                    FB.init({
                        appId: '625973994105500',
                        status: true,
                        xfbml: true
                    });
                };

                (function (d, s, id) {
                    var js, fjs = d.getElementsByTagName(s)[0];
                    if (d.getElementById(id)) return;
                    js = d.createElement(s); js.id = id;
                    js.src = "//connect.facebook.net/ko_KR/all.js";
                    fjs.parentNode.insertBefore(js, fjs);
                }(document, 'script', 'facebook-jssdk'));
            </script>
            <!-- (e) 페이스북 공통 영역 (e) -->

            <!-- (s) 헤더 영역 (s) -->
            <header class="masthead">
	            <div id="myCarousel" class="carousel slide">
		            <div class="carousel-inner">
			            <div class="item active">
				            <div class="container">
					            <div class="carousel-caption" >
						            <h1 class="logo">HinoKY</h1>
						            <h2 class="logo-desc">Personal IT Site. Made By Korean.</h2>
					            </div>
				            </div>
			            </div>
		            </div>
	            </div>
	
            </header>
            <!-- (e) 헤더 영역 (e) -->  
  
            <!-- Fixed navbar -->
            <div class="navbar navbar-custom navbar-inverse navbar-static-top" id="nav">
                <div class="container">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                    </div>
                    <div class="collapse navbar-collapse">
                        <ul class="nav navbar-nav nav-justified">
                            <li id="active"><a href="/board/list?category=*" class="current">Articles</a></li>
                            <li><a href="/backlog/getbackloglist">BackLog</a></li>
                            <li class="dropdown">
                                <a href="#section3" class="dropdown-toggle" data-toggle="dropdown">Laboratory <b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    <li><a href="/recruitInfo">국내 구인현황 트래킹</a></li>
                                    <li><a href="/icongenerator/index">이미지 to 아이콘 변환기</a></li>
                                    <li><a href="/2048" >웹게임 2048</a></li>
                                </ul>
                            </li>
                            <li><a href="/guestbook/list?location=GUESTBOOK&subKey=0&pageSize=10">Guest Book</a></li>
                            <li><a href="#" onclick="alert('준비중입니다. 방명록을 이용해주세요.'); return false;" >Contract Us</a></li>
                            @*<li><a href="/home/contractus">Contract Us</a></li>*@
                        </ul>
                    </div><!--/.nav-collapse -->
                </div><!--/.container -->
            </div><!--/.navbar -->
  
            <div class="container" style="width:100%">
                <div class="col-sm-2 left-area">
                    <div class="row text-center" >
                        <div class="col-md-12 after-signin">
                            <div class="col-md-12">
                                <b>Hinoky</b><br />
                                숑(개발) & GM(UX 기술고문)
                            </div>
                            <img id="imgProfileUploadArea" class="img-thumbnail col-sm-10 col-sm-offset-1" src="/images/drop-your-drawers-here.jpg" alt="" />
                            <p />
                            <div class="col-md-12" style="margin-top:10px;" >
                                <span class="text-info">
                                    가오픈입니다.<br />
                                </span>
                            </div>
                            @if (WebLib.AuthorizeService.MemberInfo.Instance.IsSignIn)
                            {        
                                <div class="col-md-12" style="margin-top:10px;">
                                    <a href="#" id="btnLogout" onclick="return false;" rel="nofollow" class="label label-info" title="Login">Logout</a>
                                </div>
                            }
                        </div>
                    </div>
                    <Br />
                    <div class="row">
                        @if (Request.Url.AbsoluteUri.IndexOf("hinoky.com") > -1)
                        {
                            <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                            <!-- LEFT_2 -->
                            <ins class="adsbygoogle"
                                 style="display: inline-block; width: 300px; height: 250px"
                                 data-ad-client="ca-pub-7549488601220310"
                                 data-ad-slot="7652813389"></ins>
                            <script>
                                (adsbygoogle = window.adsbygoogle || []).push({});
                            </script>
                        }
                    </div>
                    <Br />
                    <div id="divMainKeyword" class="row main-keyword" ></div>
                </div>
                <div class="col-sm-8" > 
                    @RenderBody()
                </div>
                <div class="col-sm-2 right-area" style="padding:0">
                    
                    @if (Request.Url.AbsolutePath == "/" || Request.Url.AbsoluteUri.ToLower().Contains("board"))
                    {
                        @Html.Partial("_ArticleCategoryArea");
                    }
                    else if (Request.Url.AbsoluteUri.ToLower().Contains("backlog"))
                    {
                        @Html.Partial("_BackLogPartial");
                    }
                    <p />
                    <div class="row">
                        @if (Request.Url.AbsoluteUri.IndexOf("hinoky.com") > -1)
                        {
                            <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                            <!-- 오른쪽 광고 - 1 -->
                            <ins class="adsbygoogle"
                                 style="display: inline-block; width: 250px; height: 250px"
                                 data-ad-client="ca-pub-7549488601220310"
                                 data-ad-slot="7688009389"></ins>
                            <script>
                                (adsbygoogle = window.adsbygoogle || []).push({});
                            </script>
                        }
                    </div>
                </div>
            </div>
  
        </div><!--/wrap-->

        <div id="footer">
            <div class="container">
                <p class="text-muted">Copyright ©2014 ACME, Inc.</p>
            </div>
        </div>

        <ul class="nav pull-right scroll-top">
            <li><a href="#" title="Scroll to top" onclick="return false;" ><i class="glyphicon glyphicon-chevron-up"></i></a></li>
        </ul>
        
        
        <!-- (s) Common Modal Popup & Template -->

        <!-- (s) 댓글 등록 팝업 (s) -->
        @Html.Partial("_GuestBookWriteArea");

        <!-- (s) 답글 등록 팝업 (s) -->
        @Html.Partial("_GuestBookReplyArea");
        
        <!-- (s) Ajax Action 후 렌더링 되는 HTML 코드 영역 -->
        @Html.Partial("_GuestBookAjaxArea");
        
        <!-- (e) Common Modal Popup & Template -->


        <!-- Bootstrap core JavaScript
            ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->
        <script src="/Scripts/bootstrap.js"></script>
        <script src="/Scripts/bootbox.min.js"></script>
        
        <!-- Google Analytics
            ============================================ -->
        <script type="text/javascript" >
            if (window.location.host.indexOf("hinoky.com") > -1) {
                (function(i, s, o, g, r, a, m) {
                    i['GoogleAnalyticsObject'] = r;
                    i[r] = i[r] || function() {
                        (i[r].q = i[r].q || []).push(arguments)
                    }, i[r].l = 1 * new Date();
                    a = s.createElement(o),
                        m = s.getElementsByTagName(o)[0];
                    a.async = 1;
                    a.src = g;
                    m.parentNode.insertBefore(a, m)
                })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

                ga('create', 'UA-52575909-1', 'auto');
                ga('send', 'pageview');
            }
        </script>
    </body>
</html>
